#ifndef _SDL_EXCEPTION_H_
#define _SDL_EXCEPTION_H_

#include <exception>
#include <string>
#include <SDL/SDL.h>

namespace sdl {

class Exception : public std::exception {
public:
	Exception(const char* reason) : str(reason) {
		str.append(": ");
		str.append(SDL_GetError());
	}
	virtual ~Exception() throw() { }

	virtual const char* what() const throw() {
		return str.c_str();
	}

private:
	std::string str;
};

} // namespace sdl

#endif // _SDL_EXCEPTION_H_

